package com.ggqq.controller;

import com.ggqq.entity.FriendLink;
import com.ggqq.service.FriendLinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;


/**
 * 友链 控制器
 * */

@Controller
public class FriendLinkShowController {

    @Autowired
    private FriendLinkService friendLinkService;

    @GetMapping("/friends")
    public String friends(Model model){
        List<FriendLink> friendLinks = friendLinkService.listFriendLink();
        model.addAttribute("friendlinks",friendLinks);
        return "friends";
    }

}
